<?
	require_once dirname(__FILE__) . '/../inc/functions.php';
	require_once dirname(__FILE__) . '/data.php';
	$section='Users';
	$result = GetAll($_REQUEST['User_id']);
?>

<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Users</title>
        <style type="text/css">
			.new-row { background: #CC0; }
		</style>
    </head>
    
    <body>
		<? include("../inc/tabs.php"); ?>
        <h1>Contact Methods</h1>
        <a href="edit.php">Add</a>
        <table>
        	<tr>
            	<th>User</th>
            	<th>Type</th>
            	<th>Value</th>
            </tr>
			<? while($rs = $result->fetch_assoc()){ ?>
            	<tr class="<?= $_REQUEST['new_id']==$rs['id'] ? 'new-row' : '' ?>">
                	<td>
						<?=$rs['FirstName']?> <?=$rs['LastName']?>
                     </td>
                	<td><?=$rs['Name']?></td>
                    <td><?=$rs['Value']?></td>
                    <td>
                    	<a href="../ContactMethods/edit.php?id=<?=$rs['id']?>">Edit</a>
                        <a href="../ContactMethods/delete.php?id=<?=$rs['id']?>">Delete</a>
                        <a href="../ContactMethods/details.php?id=<?=$rs['id']?>">View</a>
                    </td>
                </tr>
            <? } ?>
        </table>
    </body>
</html>

<? //$conn->close(); ?>